import Vue from 'vue'

import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Calendar from '../views/Welcome.vue'
import Nav from '../views/Nav.vue'
import About from '../views/About.vue'
import CustomEnumVue from '../views/tools/CustomEnumVue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    // 主页为 Home组件
    name: 'Home',
    component: Home,
    // 主页重定向到常用工具
    redirect: '/Nav',
    // 子路由
    children: [
      // 日历
      { path: '/calendar', name: 'Calendar', component: Calendar },
      // 常见网址
      { path: '/Nav', name: 'Nav', component: Nav },
      // 关于笔者
      { path: '/about', name: 'About', component: About },
      // 自定义枚举生成
      { path: '/customEnumVue', name: 'CustomEnumVue', component: CustomEnumVue }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
